package com.zhongli.devplatform.controller.im;

import com.alibaba.fastjson.JSONObject;
import com.zhongli.devplatform.service.imp.im.CallBackService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.Map;

/**
 * @author WuXiCheng
 * @version 1.0
 */
@RestController
@RequestMapping("/im/callback")
public class CallBackController {

    @Autowired
    private CallBackService callBackService;


    @RequestMapping("/base")
    public Map<String, Object> imCallBackBase(HttpServletRequest request, @RequestBody String body){

        JSONObject json = JSONObject.parseObject(body);
        return callBackService.imCallBackBase(request, json);
    }
}
